<script setup>
import { ref } from 'vue'
const positionList = ref([
  {
    id: 1,
    name: '前端开发',
    salary: '15k-25k',
    address: '北京',
    company: '字节跳动',
    experience: '3-5年',
    education: '本科',
    finance: '未上市',
    type: '开发岗'
  },
  {
    id: 2,
    name: '后端开发',
    salary: '20k-30k',
    address: '上海',
    company: '阿里巴巴',
    experience: '5-10年',
    education: '硕士',
    finance: '上市公司',
    type: '开发岗'
  },
  {
    id: 3,
    name: 'UI设计',
    salary: '10k-15k',
    address: '深圳',
    company: '腾讯',
    experience: '1-3年',
    education: '大专',
    finance: '上市公司',
    type: '设计岗'
  },
  {
    id: 4,
    name: '产品经理',
    salary: '25k-35k',
    address: '广州',
    company: '百度',
    experience: '8-10年',
    education: '本科',
    finance: '未上市',
    type: '产品岗'
  },
  {
    id: 5,
    name: '测试工程师',
    salary: '12k-18k',
    address: '杭州',
    company: '京东',
    experience: '2-5年',
    education: '大专',
    finance: '上市公司',
    type: '测试岗'
  },
  {
    id: 6,
    name: '运维工程师',
    salary: '18k-25k',
    address: '成都',
    company: '华为',
    experience: '3-8年',
    education: '本科',
    finance: '上市公司',
    type: '维护'
  },
  {
    id: 7,
    name: '数据分析师',
    salary: '15k-20k',
    address: '武汉',
    company: '美团',
    experience: '1-3年',
    education: '本科',
    finance: '上市公司',
    type: '数据岗'
  },
  {
    id: 8,
    name: '市场推广',
    salary: '10k-15k',
    address: '南京',
    company: '滴滴',
    experience: '1-2年',
    education: '大专',
    finance: '未上市',
    type: '宣传推广'
  },
  {
    id: 9,
    name: '人力资源',
    salary: '8k-12k',
    address: '西安',
    company: '网易',
    experience: '1-3年',
    education: '大专',
    finance: '上市公司',
    type: '企业服务'
  }
])
</script>
<template>
  <div class="grid grid-9">
    <div class="position-item-box" v-for="item in positionList" :key="item.id">
      <el-card>
        <a href="" class="job-info">
          <div class="sub-top">
            <div class="sub-info">
              <p class="job-name">
                {{ item.name }}
              </p>
              <div class="icon"></div>
            </div>
            <p class="salary">{{ item.salary }}</p>
          </div>
          <p class="job-tag">
            <span>{{ item.address }}</span>
            <span>{{ item.experience }}</span>
            <span>{{ item.education }}</span>
          </p>
        </a>

        <footer class="sub-bottom">
          <a href="" class="user-info">
            <p class="left">
              <img src="@/assets/homepage/testicon.png" />
              <span class="company-name">{{ item.company }}</span>
            </p>
            <p class="right">
              <span class="type">{{ item.type }}</span>
              <span class="vline"></span>
              <span class="finance">{{ item.finance }}</span>
            </p>
          </a>
        </footer>
      </el-card>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.position-item-box {
  height: 136px;
  // border-radius: 12px;
  margin: 0 16px 16px 0;
}

.position-item-box:nth-child(3n) {
  margin-right: 0;
}

.el-card {
  border: none;
  :deep() {
    .el-card__body {
      padding: 0;
    }
  }
}

.job-info {
  display: inline-block;
  width: 100%;
  padding: 16px 20px;
}

.sub-top {
  display: flex;
  width: 100%;
  align-items: center;
  margin-bottom: 12px;
}

.sub-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  height: 22px;
  overflow: hidden;
  flex: 1;
}

.job-name {
  color: #222;
  max-width: 200px;
  font-weight: 500;
  line-height: 22px;
  transition: all 0.2s linear;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
  position: relative;
}

.job-info:hover .job-name {
  color: #409eff;
}

.salary {
  font-size: 16px;
  font-weight: 500;
  color: #fe574a;
  line-height: 22px;
  flex: none;
}

.icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  background: url('@/assets/homepage/message.png') 0 -16px / 16px auto no-repeat;
}

.icon:hover {
  background: url('@/assets/homepage/message.png') 0 0 / 16px auto no-repeat;
}

.job-tag {
  font-size: 13px;
  color: #8d92a1;
  height: 22px;
  line-height: 22px;
  max-width: none;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
  word-break: break-all;
}

.job-tag span {
  display: inline-block;
  font-size: 13px;
  font-weight: 400;
  color: #666;
  line-height: 18px;
  padding: 2px 10px;
  border-radius: 4px;
  background: #f8f8f8;
}

.job-tag span + span {
  margin-left: 8px;
}

.sub-bottom {
  background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  margin-top: 0;
  padding-top: 0;
  display: block;
  border: none;
}

.user-info {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  vertical-align: middle;
}

.user-info img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  border-radius: 2px;
}

.company-name {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  height: 24px;
  line-height: 24px;
  color: #666;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  transition: all 0.2s linear;
}

.user-info:hover .company-name {
  color: #409eff;
}

.right {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #666;
  height: 24px;
  line-height: 24px;
}

.type {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>
